package com.hdf.etdemo.dialog;

import java.util.ArrayList;
import java.util.List;

import com.hdf.easytools.base.EasyToolsActivity;
import com.hdf.etdemo.Adapter;
import com.hdf.etdemo.R;
import com.hdf.etdemo.R.array;
import com.hdf.etdemo.R.drawable;
import com.hdf.etdemo.R.id;
import com.hdf.etdemo.R.layout;
import com.hdf.etdemo.dialog.bigkoo.DialogActivity;
import com.hdf.etdemo.dialog.ios.IosDialogActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class DialogTypeActivity extends EasyToolsActivity {
	/**资源对象*/
	public Resources res;
	private ListView mainLv;
	private Context context=DialogTypeActivity.this;
	private Adapter adapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_dialog_type);
		/**设置标题显示*/
		this.TitleVisib(0, 1, 1, 0, 0);
		/**绑定标题点击事件*/
		this.TitleClick(0, 1, 0, 0, 0);
		/**设置标题样式ʽ*/
		res=this.getResources();
		this.TitleStyle(null,R.drawable.et_back, "弹框", null,0);
		String str[]=res.getStringArray(R.array.dialogdata);
		List<String> data=new ArrayList<String>();
		for (int i = 0; i < str.length; i++) {
			data.add(str[i]);
		}
		adapter=new Adapter(context);
		adapter.setAppList(data);
		mainLv = (ListView) findViewById(R.id.dialoglv);
		mainLv.setAdapter(adapter);
		mainLv.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
				// TODO Auto-generated method stub
				intent(arg2);
			}
		});
	}

	private Intent intent;
	private void intent(int item)
	{
		if(item==0)
			GoActivity(IosDialogActivity.class);
		if(item==1)
			GoActivity(DialogActivity.class);
		
		
	};


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.left_img:
				finish();
			break;

		default:
			break;
		}
	}
}
